import {
	post
} from 'utils/requests'
/**
 * @function getMyOrderByPage
 * @description 查看自己下单别人产品的订单list 分页
 * @param {Number} pageNo 
 * @param {Number} pageSize
 * @return {Promise}
 */
export const getMyOrderByPage = (pageNo,pageSize) => post({
	url: `/applet/order/getMyOrderPage`,
	data: {
		pageNo,
		pageSize
	},
	json: "json",
	loading: true
})

//根据订单id取消未签名的订单
export const cancelUnsignedOrderById = id => post({
	url:`/applet/order/cancelUnsignedOrderById/${id}`
})

//根据订单id删除订单
export const delOrderById = (type,id) => post({
	url:`/applet/order/delOrderById/${type}/${id}`	
})

//获取指定时间段的订单记录 分页
export const getOrderOfTheSpecifiedTimePeriodPage = (startTime,endTime,pageNo,pageSize) => post({
	url:`/applet/order/getOrderOfTheSpecifiedTimePeriodPage/${startTime}/${endTime}`,
	data: {
		pageNo,
		pageSize
	},
})

//根据订单id同意交易
export const agreeOrderById = (id,sellerSignature) => post({
	url:`/applet/mine/order-handler/agreeOrderById`,
	data:{
		id,
		sellerSignature
	},
	json: "json",
	loading: true
})

//根据订单id删除订单
export const delOrderByIdMine = (type,id) => post({
	url:`/applet/mine/order-handler/delOrderById/${type}/${id}`
})

//根据订单id查看订单详情
export const getOrderInfoById = id => post({
	// url: `/applet/order/getOrderInfoById/${id}`
	url: `/applet/mine/order-handler/getOrderInfoById/${id}`
})

//查看订单合同
export const getOrderContractInfoById = (id) => post({
	url:`/applet/mine/order-handler/getOrderContractInfoById/${id}`,
})

//查看自己订单模块的数据
export const getQuantitiesOfVariousOrders = () => post({
	url:`/applet/mine/order-handler/getQuantitiesOfVariousOrders`,
})

//根据类型查看别人下单自己产品的订单分页
export const getOrderPageByType = (pageNo,pageSize,type) =>post({
	url:`/applet/mine/order-handler/getOrderPageByType/${type}`,
	data:{
		pageNo,
		pageSize
	},
	json: "json",
	loading: true
})

//根据订单id拒绝交易
export const refuseOrderById = (feedBack,id) => post({
	url:`/applet/mine/order-handler/refuseOrderById`,
	data:{
		feedBack,
		id
	},
	json: "json",
	loading: true
})